home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel PPC / diff / lib_std.old.old < prev    next >
Encoding:
Text File  |  1996-06-13  |  4.0 KB  |  173 lines  |  [TEXT/EDIT]

  1. diff -r lib_std/array.e /users/prof/colnet/SmallEiffel/lib_std/array.e
  2. 11,12c11
  3. < creation {ANY}
  4. <    make
  5. ---
  6. > creation make
  7. 179a179
  8. >      lower = old lower
  9. 184a185,186
  10. >       local
  11. >      i: INTEGER;
  12. 185a188,195
  13. >      from
  14. >         i := lower;
  15. >      until
  16. >         i = upper
  17. >      loop
  18. >         put(item(i+1),i);
  19. >         i := i + 1;
  20. >      end;
  21. 188a199
  22. >      upper = old upper;
  23. diff -r lib_std/array.e /users/prof/colnet/SmallEiffel/lib_std/array.elib_std/double.e /users/prof/colnet/SmallEiffel/lib_std/double.e
  24. 153d152
  25. <      str.extend('.');
  26. 155,164c154,166
  27. <      from
  28. <      invariant
  29. <         d < 1;
  30. <      until
  31. <         d = 0.0
  32. <      loop
  33. <         d := d * 10.0;
  34. <         i := d.floor;
  35. <         d := d - i;
  36. <         str.extend(i.digit);
  37. ---
  38. >      if d /= 0.0 then
  39. >         from
  40. >            str.extend('.');
  41. >         invariant
  42. >            d < 1;
  43. >         until
  44. >            d = 0.0
  45. >         loop
  46. >            d := d * 10.0;
  47. >            i := d.floor;
  48. >            d := d - i;
  49. >            str.extend(i.digit);
  50. >         end;
  51. diff -r lib_std/double.e /users/prof/colnet/SmallEiffel/lib_std/double.elib_std/fixed_array.e /users/prof/colnet/SmallEiffel/lib_std/fixed_array.e
  52. 6,7c6,8
  53. <    -- The `lower' bound is frozen. Thus, FIXED_ARRAY should
  54. <    -- run a little bit faster than ARRAY.
  55. ---
  56. >    -- Unlike ARRAY, the `lower' bound of a FIXED_ARRAY is
  57. >    -- frozen (to 0). Thus, when looping toward 0, code may 
  58. >    -- run (just) a little bit faster than ARRAY.
  59. 8a10,12
  60. >    -- Note: a FIXED_ARRAY as only two attributes it save 
  61. >    --       a little bit memory too :-)
  62. >    --
  63. 10c14,17
  64. < inherit COLLECTION[E];
  65. ---
  66. > inherit
  67. >    COLLECTION[E]
  68. >       redefine is_equal, fast_nb_occurrences, all_cleared
  69. >       end;
  70. 89a97,157
  71. > feature -- Looking and comparison :
  72. >    is_equal(other: like Current): BOOLEAN is
  73. >      -- Use `equal' to compare elements. 
  74. >       local
  75. >      i: INTEGER;
  76. >      e1, e2: E;
  77. >       do
  78. >      if Current = other then
  79. >         Result := true;
  80. >      elseif upper = other.upper then
  81. >         from
  82. >            Result := true;
  83. >            i := upper;
  84. >         until
  85. >            i < 0 or not Result
  86. >         loop
  87. >            Result := equal_like(item(i),other.item(i));
  88. >            i := i - 1;
  89. >         end;        
  90. >      end;
  91. >       end;
  92. >    all_cleared: BOOLEAN is
  93. >      -- Are all items set to default values?
  94. >       local
  95. >      value: E;
  96. >      i: INTEGER;
  97. >       do
  98. >      from  
  99. >         Result := true;
  100. >         i := upper;
  101. >      until
  102. >         i < lower
  103. >      loop
  104. >         Result := value = item(i);
  105. >         if Result then
  106. >            i := i - 1;
  107. >         else
  108. >            i := -1;
  109. >         end;
  110. >      end;
  111. >       end;
  112. >    fast_nb_occurrences(elt: E): INTEGER is
  113. >      -- Number of occurrences using `='.
  114. >       local
  115. >      i: INTEGER;
  116. >       do
  117. >      from  
  118. >         i := upper;
  119. >      until
  120. >         i < 0
  121. >      loop
  122. >         if elt = item(i) then
  123. >            Result := Result + 1;
  124. >         end;
  125. >         i := i - 1;
  126. >      end;
  127. >       end;
  128. >       
  129. diff -r lib_std/fixed_array.e /users/prof/colnet/SmallEiffel/lib_std/fixed_array.elib_std/general.e /users/prof/colnet/SmallEiffel/lib_std/general.e
  130. 68,69c68
  131. <      if is_expanded_type then
  132. <      else
  133. ---
  134. >      if not is_expanded_type then
  135. 77,91d75
  136. <    frozen new_same_type(other: GENERAL): BOOLEAN is
  137. <      -- Is type of current object identical to type of other.     
  138. <       require
  139. <      other_not_void: other /= Void;
  140. <       do
  141. <      if is_expanded_type then
  142. <         -- *** Could write not is_expanded !!
  143. <      else
  144. <         c_inline_c("R=(C->id)==(a1->id);");
  145. <      end;
  146. <       ensure
  147. <      definition: Result = (conforms_to(other) and
  148. <                    other.conforms_to(Current));
  149. <       end;
  150. <    
  151. 185c169
  152. <         c_inline_c("R=(T0 *)new(a1->id);");
  153. ---
  154. >         c_inline_c("R=(T0 *)se_new(a1->id);");
  155. 225c209
  156. <         c_inline_c("R=(T0 *)new(a1->id);%N%
  157. ---
  158. >         c_inline_c("R=(T0 *)se_new(a1->id);%N%
  159. 374c358
  160. <      %fclose(f);}");
  161. ---
  162. >      %if (R) fclose(f);}");
  163. diff -r lib_std/general.e /users/prof/colnet/SmallEiffel/lib_std/general.elib_std/std_file.e /users/prof/colnet/SmallEiffel/lib_std/std_file.e
  164. 39d38
  165. <      path /= Void;
  166. 69c68
  167. <    fclose (stream_pointer : POINTER): INTEGER is
  168. ---
  169. >    fclose(stream_pointer : POINTER): INTEGER is
  170.